﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Server
{
    public partial class MultipleProcesses : Form
    {
        public int PID;
        private Process[] m_FFXiProcesses;

        public MultipleProcesses()
        {
            InitializeComponent();
            m_FFXiProcesses = Process.GetProcessesByName("pol");
            foreach(Process p in m_FFXiProcesses)
                processCombo.Items.Add(p.MainWindowTitle);
            processCombo.SelectedIndex = 0;
        }

        private void confirmButton_Click(object sender, EventArgs e)
        {
            foreach (Process p in m_FFXiProcesses)
            {
                if (p.MainWindowTitle == (string)processCombo.SelectedItem)
                {
                    PID = p.Id;
                    break;
                }
            }

            Close();
        }
    }
}
